package org.eclipse.emf.cdo.ui.merge;

import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.internal.common.revision.delta.CDOFeatureDeltaImpl;

/**
 * Extends a TreeObject for a conflict leaf.
 *
 * @author Thomas Halmetschlager
 */
public class ConflictTreeObject extends TreeObject{

	/** The revision number. */
	private CDORevisionDelta revision;
	
	/** The source branch. */
	private CDOBranch sourceBranch;
	
	/** The target branch. */
	private CDOBranch targetBranch;
	
	/**
	 * Gets the source branch.
	 *
	 * @return the source branch
	 */
	public CDOBranch getSourceBranch() {
		return sourceBranch;
	}
	
	/**
	 * Sets the source branch.
	 *
	 * @param sourceBranch the new source branch
	 */
	public void setSourceBranch(CDOBranch sourceBranch) {
		this.sourceBranch = sourceBranch;
	}
	
	/**
	 * Gets the target branch.
	 *
	 * @return the target branch
	 */
	public CDOBranch getTargetBranch() {
		return targetBranch;
	}
	
	/**
	 * Sets the target branch.
	 *
	 * @param targetBranch the new target branch
	 */
	public void setTargetBranch(CDOBranch targetBranch) {
		this.targetBranch = targetBranch;
	}
	
	/**
	 * Gets the revision number.
	 *
	 * @return the revision number
	 */
	public CDORevisionDelta getCdoid() {
		return revision;
	}
	
	/**
	 * Sets the revision number.
	 *
	 * @param cdoid the new revision number
	 */
	public void setRevision(CDORevisionDelta cdoid) {
		this.revision = cdoid;
	}
	
	/**
	 * Instantiates a new conflict tree object.
	 *
	 * @param name the name
	 */
	public ConflictTreeObject(String name) {
		super(name);
	}
	
	/**
	 * Instantiates a new conflict tree object.
	 *
	 * @param name the name
	 * @param cdoid the CDO ID
	 */
	public ConflictTreeObject(String name,CDORevisionDelta cdoid) {
		super(name);
		this.revision = cdoid;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.emf.cdo.ui.merge.TreeObject#toString()
	 */
	public String toString() {
		/*String deltaString;
		deltaString ="";
		for(CDOFeatureDelta delta:revision.getFeatureDeltas()){
			deltaString = deltaString + "" +delta.toString();
		}*/
		return getName() ;
	} 
}
